<template>
    <view class="smmart-page-head">
        <view class="smart-page-head-title">text文本编辑</view>
    </view>
    <view>
        <view class="text-box">
            <text>{{text}}}</text>
        </view>
        <button type="primary" @click="add()">添加行</button>
        <button type="warn" @click="del()">删除行</button>
    </view>
</template>

<script>
    export default{
        data(){
            return {
                texts:[
                    "hbuilder",
                    'uniapp',
                    'smart'
                ],
                extraLine:[],
                text:'guilin travle\n'
            }
        },
        methods:{
            add(){
                console.log('add....')
                this.extraLine.push(this.texts[this.extraline, length%3]);
                this.text = this.extraLine.jpoin('\n');
            }
            del(){
                console.log('del....')
                this.extraLine.pop();
                this.text = this.extraLine.jpoin('\n');
            }
    }
</script>